// 今日不再提示 cookie 设置

// 设置cookie时间
export function setcookieTimeFun(name, value,Days){
    value = new Date().getDate();
    var exp = new Date(); 
    exp.setTime(exp.getTime() + Days*24*60*60*1000); 
    document.cookie = name+"="+value+";expires=" + exp.toGMTString(); 
}

// 取出设置的cookie时间,存在就返回获取到的值,不存在返回''
export function getCookieFun(c_name){
        if (document.cookie.length > 0){
            let c_start = document.cookie.indexOf(c_name+"="); 
            if(c_start != -1){
                c_start = c_start + c_name.length+1;
                let c_end = document.cookie.indexOf(";", c_start)
                if (c_end == -1){
                    c_end = document.cookie.length;
                }
                return decodeURIComponent(document.cookie.substring(c_start, c_end));
            }
        }
        return "";
}

// 移除某一个cookie
function delTimeCookie(name){
    var exp = new Date(); 
    exp.setTime(exp.getTime() - 1); 
    var cval=getCookieFun(name); 
    if(cval!=null) 
        document.cookie= name + "="+cval+";expires="+exp.toGMTString(); 
}